package main

import (
	"fmt"
	"time"
)

var message = make(chan string)

func test() {
	message <- "Hello goroutine!"
}

func test2() {
	time.Sleep(3 * time.Second)
	str := <-message // channel 读出消息
	str = str + "aqie"
	message <- str
}
func main() {
	go test() // 显式调用
	go test2()
	time.Sleep(2 * time.Second)
	fmt.Println(<-message)
	fmt.Println("Hello Golang")

}
